package com.gree.common.utils;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public final class Constants {

    public Constants() {
    }

    public static final String replaceComp2(String comp) {
        if (compMap.containsKey(comp))
            return (String) compMap.get(comp);
        else
            return "";
    }


    // 转换所属领域的主公司代码
    public final static String replaceComp(String comp) {
        return compMap.getOrDefault(comp, comp);
    }

    // 获取主公司下面所有子公司代码
    public final static List<String> getComps(String comp) {
        return compList.get(replaceComp(comp));
    }

    // 目前所有领域的主公司代码
    public final static List<String> getPComps() {
        List<String> pcomps = new ArrayList<String>(compList.keySet());
        return pcomps;
    }

    public static final HashMap<String, List<String>> getCompList() {
        return compList;
    }

    public static final int getDEFAULT_PORT(String _comp) {
        return 8078;
    }

    private static final HashMap<String, String> compMap;
    private static final HashMap<String, List<String>> compList;
    public static final String ADMINISTRATOR = "ADMINISTRATOR";
    public static final boolean EMAIL_SEND = true;
    public static final String SMLOG00 = "smlog00";
    public static final String COMPANYS = "all_company";
    public static final String LOGINPATH = "/login.do";
    public static final String FORWORD = "forword_URL_name";
    public static final String ERRMSGS = "error_messages";
    public static final String ERRTLE = "error_title";
    public static final String ERRCAP = "error_caption";
    public static final String NOTRETURN = "noShowReturnButton";
    public static final String USERINFO = "Scm_User_LoginInfo";
    public static final String USERMENU = "Scm_User_MenuInfo";// Constants.USERMENU
    public static final int DEFROWS = 19;
    public static final String DATALIST = "display_data_list";
    public static final boolean COMPRESS = false;
    public static final boolean DECOMPRESS = true;
    public static final String DEFAULT_HOST = "10.1.11.93";
    public static final int REPORTS_CUT = 30001;
    public static final long IMPORT_CANNOT = 10003L;
    public static final long IMPORT_NODATA = 10002L;
    public static final int IMPORT_TAKE = 10001;
    public static final long IMPORT_ERROR = 10000L;
    public static final int SMBSE02_IMPORT = 1002;
    public static final int SMBSE18_IMPORT = 1018;
    public static final int SMJCC00ONE_IMPORT = 2002;
    public static final int SMJCC00TWO_IMPORT = 2001;
    public static final int SMJCC00THREE_IMPORT = 2003;
    public static final int SMPUR00_IMPORT = 3000;
    public static final int SMPUR01_IMPORT = 3001;
    public static final int SMPUR00TWO_IMPORT = 3002;
    public static final int SMPUR01TWO_IMPORT = 3003;
    public static final int SMPUR02_UPDATE = 3004;
    public static final int SMPUR00998_IMPORT = 3005;
    public static final int SMPUR00THREE_IMPORT = 3006;
    public static final int SMPUR05_IMPORT = 3007;
    public static final int SMGKC00_IMPORT = 4000;
    public static final int SMGKC05_IMPORT = 4001;
    public static final int SMACP00_IMPORT = 5000;
    public static final int SMDEM00_IMPORT = 6000;
    public static final int SMDEM01_IMPORT = 6001;
    public static final int SMSFC00_IMPORT = 7000;
    public static final int SMTHD00_IMPORT = 8000;
    public static final int SMHMD00_IMPORT = 9000;
    public static final int SMHMD01_IMPORT = 9001;
    public static final int SMSLS00_IMPORT = 11000;
    public static final int SMQAN00_IMPORT = 12000;
    public static final int SMSCT00_IMPORT = 13000;
    public static final String ADMINSTRING = "<span>[系统管理]&nbsp;&nbsp;内线：83098&nbsp;&nbsp;外线：0756-8669098</span>";

    /*2020/11*/
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 当前记录起始索引
     */
    public static final String PAGE_NUM = "pageNum";

    /**
     * 每页显示记录数
     */
    public static final String PAGE_SIZE = "pageSize";

    /**
     * 排序列
     */
    public static final String ORDER_BY_COLUMN = "orderByColumn";

    /**
     * 排序的方向 "desc" 或者 "asc".
     */
    public static final String IS_ASC = "isAsc";

    /**
     * 参数管理 cache name
     */
    public static final String SYS_CONFIG_CACHE = "sys-config";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache name
     */
    public static final String SYS_DICT_CACHE = "sys-dict";

    /**
     * 接口管理 cache key
     */
    public static final String SYS_API_KEY = "sys-api:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";


    static {
        compMap = new HashMap<String, String>();
        compList = new HashMap<String, List<String>>();
        HashMap<String, String> map400 = new HashMap<String, String>();
        map400.put("300", "400");
        map400.put("500", "400");
        map400.put("339", "400");
        map400.put("358", "400");
        map400.put("560", "400");
        map400.put("610", "400");
        map400.put("751", "400");
        map400.put("178", "400");
        map400.put("666", "400");
        map400.put("3000", "400");
        map400.put("677", "400");
        map400.put("196", "400");
        map400.put("1008", "400");// 洛阳格力
        /*map400.put("1001", "400");// 旧洛阳格力*/
        map400.put("1006", "400");//南京格力
        map400.put("2201", "400");//成都格力
        map400.put("980", "400");
        map400.put("960", "400");
        map400.put("970", "400");
        map400.put("776", "400"); // 珠海物资公司
        List<String> list400 = new ArrayList<String>();
        list400.add("400");
        list400.addAll(map400.keySet());
        map400.put("400", "400");
        HashMap<String, String> map600 = new HashMap<String, String>();
        map600.put("506", "600");
        map600.put("306", "600");
        map600.put("566", "600");
        map600.put("330", "600");
        map600.put("380", "600");
        List<String> list600 = new ArrayList<String>();
        list600.add("600");
        list600.addAll(map600.keySet());
        map600.put("600", "600");
        //HashMap<String, String> map980 = new HashMap<String, String>();
        //map980.put("960", "980");
        //map980.put("970", "980");
        //List<String> list980 = new ArrayList<String>();
        //list980.add("980");
        //list980.addAll(map980.keySet());
        //map980.put("980", "980");
        HashMap<String, String> map850 = new HashMap<String, String>();
        map850.put("308", "850");
        map850.put("355", "850");
        map850.put("510", "850");
        List<String> list850 = new ArrayList<String>();
        list850.add("850");
        list850.addAll(map850.keySet());
        map850.put("850", "850");
        HashMap<String, String> map720 = new HashMap<String, String>();
        map720.put("319", "720");
        map720.put("725", "720");
        map720.put("721", "720");
        List<String> list720 = new ArrayList<String>();
        list720.add("720");
        list720.addAll(map720.keySet());
        map720.put("720", "720");
        HashMap<String, String> map230 = new HashMap<String, String>();
        List<String> list230 = new ArrayList<String>();
        list230.add("230");
        list230.addAll(map230.keySet());
        map230.put("230", "230");
        HashMap<String, String> map370 = new HashMap<String, String>();
        map370.put("570", "370");
        map370.put("373", "370");
        map370.put("385", "370");
        List<String> list370 = new ArrayList<String>();
        list370.add("370");
        list370.addAll(map370.keySet());
        map370.put("370", "370");

        HashMap<String, String> map371 = new HashMap<String, String>();
        List<String> list371 = new ArrayList<String>();
        map371.put("371", "371");
        map371.put("382", "371");
        list371.add("371");
        list371.addAll(map371.keySet());

        HashMap<String, String> map374 = new HashMap<String, String>();
        List<String> list374 = new ArrayList<String>();
        list374.add("374");
        list374.addAll(map374.keySet());
        map374.put("374", "374");
        HashMap<String, String> map760 = new HashMap<String, String>();
        List<String> list760 = new ArrayList<String>();
        list760.add("760");
        list760.addAll(map760.keySet());
        map760.put("760", "760");
        HashMap<String, String> map700 = new HashMap<String, String>();
        List<String> list700 = new ArrayList<String>();
        list700.add("700");
        list700.addAll(map700.keySet());
        map700.put("700", "700");
        HashMap<String, String> map318 = new HashMap<String, String>();
        List<String> list318 = new ArrayList<String>();
        list318.add("318");
        list318.addAll(map318.keySet());
        map318.put("318", "318");

        /*-------------add by 180284 20180530-------------------------*/
        // 郑州再生资源
        HashMap<String, String> map352 = new HashMap<String, String>();
        List<String> list352 = new ArrayList<String>();
        list352.add("352");
        list352.addAll(map352.keySet());
        map352.put("352", "352");

        // 天津再生资源
        HashMap<String, String> map740 = new HashMap<String, String>();
        List<String> list740 = new ArrayList<String>();
        list740.add("740");
        list740.addAll(map740.keySet());
        map740.put("740", "740");

        // 长沙再生资源
        HashMap<String, String> map750 = new HashMap<String, String>();
        List<String> list750 = new ArrayList<String>();
        list750.add("750");
        list750.addAll(map750.keySet());
        map750.put("750", "750");

        // 芜湖再生资源
        HashMap<String, String> map770 = new HashMap<String, String>();
        List<String> list770 = new ArrayList<String>();
        list770.add("770");
        list770.addAll(map770.keySet());
        map770.put("770", "770");

        // 测试公司
        HashMap<String, String> map240 = new HashMap<String, String>();
        List<String> list240 = new ArrayList<String>();
        list240.add("240");
        list240.addAll(map240.keySet());
        map240.put("240", "240");

        // 组合
        compMap.putAll(map400);
        compMap.putAll(map600);
        //compMap.putAll(map980);
        compMap.putAll(map850);
        compMap.putAll(map720);
        compMap.putAll(map230);
        compMap.putAll(map370);
        compMap.putAll(map371);
        compMap.putAll(map374);
        compMap.putAll(map760);
        compMap.putAll(map700);
        compMap.putAll(map318);
        compMap.putAll(map352);
        compMap.putAll(map740);
        compMap.putAll(map750);
        compMap.putAll(map770);
        compMap.putAll(map240);
        compList.put("400", list400);
        compList.put("600", list600);
        //compList.put("980", list980);
        compList.put("850", list850);
        compList.put("720", list720);
        compList.put("230", list230);
        compList.put("370", list370);
        compList.put("371", list371);
        compList.put("374", list374);
        compList.put("760", list760);
        compList.put("700", list700);
        compList.put("318", list318);
        compList.put("352", list352);
        compList.put("740", list740);
        compList.put("750", list750);
        compList.put("770", list770);
        compList.put("240", list240);
    }
}

